import store from "@/store";
let dict = store.getters.dictList;
dict.login_type = [
  { label: "统一身份认证", value: 4 },
  // { label: "毕业生", value: 2 },
  // { label: "账号密码", value: 3 },
];

dict.svMode_map = [
  { label: "人脸验证", value: 'FACE' },
  { label: "短信验证", value: 'PHONE_CODE' },
]
// 获取字典
const getDictList = (type) => {
  return dict[type] || [];
};
// 获取字典value
const getDictLabel = (type, value, defaultLabel) => {
  let dicts = dict[type] || [];
  for (var i = 0; i < dicts.length; i++) {
    let item = dicts[i];
    if (item.value === value) {
      return item.label;
    }
  }
  if (defaultLabel) {
    return defaultLabel;
  } else {
    return "--";
  }
};

export default { getDictList, getDictLabel };
